{% extends "main.html" %}
{% block content %}
<table class="contentTable">
	<tr>
		<td class="left">
		  <form id="query_form" name="query_form" method="post" action="#">
		    <div class="inputgroup">
		      <label>Sort Results by</label>
		      <select name="sort">
		        <option value="-timestamp"
		                {% ifequal sort "-timestamp" %} selected{% endifequal %}>timestamp</option>
		        <option value="-eventtype"
		                {% ifequal sort "-eventtype" %} selected{% endifequal %}>eventtype</option>
		        <option value="-domain"
		                {% ifequal sort "-domain" %} selected{% endifequal %}>domain</option>
		      </select>
		      <div class="clear"></div>
		    </div>
		    <div class="inputgroup">
		      <label>Limit</label>
		      <input type="text" name="limit" value="{{limit}}" />
		    </div>
		    <br/><br/>


		    <h3>Filter</h3>
		    <div class="field">
		      <label>Domain</label>
		      <input type="text" name="domain"
		             value="{{ domain }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Event Type</label>
		      <input type="text" name="eventtype"
		             value="{{ eventtype }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Context</label>
		      <input type="text" name="context"
		             value="{{ context }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Key</label>
		      <input type="text" name="msg_key"
		             value="{{ msg_key }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Value</label>
		      <input type="text" name="msg_val"
		             value="{{ msg_val }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Timestamp Start</label>
		      <input type="text" name="time_from"
		             value="{{ time_from }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="field">
		      <label>Timestamp End</label>
		      <input type="text" name="time_to"
		             value="{{ time_to }}" />
		      <div class="clear"></div>
		    </div>
		    <div class="input_group">
		      <label></label>
		      <input type="submit" value="submit" />
		    </div>
		  </form>
		</td>

		<td>
			<div class="tablewrapper">
				<table class="listing">
					<thead>
						<tr class="header">
							<th class="first">Timestamp</th>
							<th>Type of Event</th>
							<th>Context</th>
							<th>Domain</th>
							<th>Key</th>
							<th>Value</th>
						</tr>
					</thead>
					<tbody>
						{% for entry in logentries %}
						<tr>
							<td class="first">{{ entry.timestamp }}</td>
							<td>{{ entry.eventtype }}</td>
							<td>{{ entry.context }}</td>
							<td>{{ entry.domain }}</td>
							<td>{{ entry.msg_key }}</td>
							<td>{{ entry.msg_value }}</td>
						</tr>
						{% endfor %}
					</tbody>

				</table>
			</div>
		</tr>
	</table>

{% endblock %}

